package kr.co.mustgo.domain.freeboard;

import java.io.Serializable;
import java.util.List;

public class FreeBoard implements Serializable {

	private int code;
	private String title;
	private String name;
	private String contents;
	private int hit;
	private String insertDate;
	private List<FreeComment> comment;
	
	public FreeBoard() {
		super();
	}

	public FreeBoard(int code, String title, String name, String contents,
			int hit, String insertDate, List<FreeComment> comment) {
		super();
		this.code = code;
		this.title = title;
		this.name = name;
		this.contents = contents;
		this.hit = hit;
		this.insertDate = insertDate;
		this.comment = comment;
	}

	public FreeBoard(String title, String name, String contents) {
		super();
		this.title = title;
		this.name = name;
		this.contents = contents;
	}

	public FreeBoard(int code, String title, String name, String contents,
			int hit, String insertDate) {
		super();
		this.code = code;
		this.title = title;
		this.name = name;
		this.contents = contents;
		this.hit = hit;
		this.insertDate = insertDate;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContents() {
		return contents;
	}

	public void setContents(String contents) {
		this.contents = contents;
	}

	public int getHit() {
		return hit;
	}

	public void setHit(int hit) {
		this.hit = hit;
	}

	public String getInsertDate() {
		return insertDate;
	}

	public void setInsertDate(String insertDate) {
		this.insertDate = insertDate;
	}

	public List<FreeComment> getComment() {
		return comment;
	}

	public void setComment(List<FreeComment> comment) {
		this.comment = comment;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + code;
		result = prime * result + ((comment == null) ? 0 : comment.hashCode());
		result = prime * result
				+ ((contents == null) ? 0 : contents.hashCode());
		result = prime * result + hit;
		result = prime * result
				+ ((insertDate == null) ? 0 : insertDate.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FreeBoard other = (FreeBoard) obj;
		if (code != other.code)
			return false;
		if (comment == null) {
			if (other.comment != null)
				return false;
		} else if (!comment.equals(other.comment))
			return false;
		if (contents == null) {
			if (other.contents != null)
				return false;
		} else if (!contents.equals(other.contents))
			return false;
		if (hit != other.hit)
			return false;
		if (insertDate == null) {
			if (other.insertDate != null)
				return false;
		} else if (!insertDate.equals(other.insertDate))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "FreeBoard [code=" + code + ", title=" + title + ", name="
				+ name + ", contents=" + contents + ", hit=" + hit
				+ ", insertDate=" + insertDate + ", comment=" + comment + "]";
	}
	
	
}
